
package com.doc2video.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 视频实体
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_video")
@ApiModel(value = "Video对象", description = "视频表")
public class Video implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "视频ID")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(value = "文档ID")
    @TableField("document_id")
    private Long documentId;

    @ApiModelProperty(value = "用户ID")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty(value = "视频名称")
    @TableField("video_name")
    private String videoName;

    @ApiModelProperty(value = "视频路径")
    @TableField("video_path")
    private String videoPath;

    @ApiModelProperty(value = "视频大小（字节）")
    @TableField("file_size")
    private Long fileSize;

    @ApiModelProperty(value = "视频时长（秒）")
    @TableField("duration")
    private Integer duration;

    @ApiModelProperty(value = "视频分辨率")
    @TableField("resolution")
    private String resolution;

    @ApiModelProperty(value = "音色类型")
    @TableField("voice_type")
    private String voiceType;

    @ApiModelProperty(value = "字幕文件路径")
    @TableField("subtitle_path")
    private String subtitlePath;

    @ApiModelProperty(value = "处理状态：0-待处理，1-处理中，2-已完成，3-失败")
    @TableField("process_status")
    private Integer processStatus;

    @ApiModelProperty(value = "处理进度（0-100）")
    @TableField("process_progress")
    private Integer processProgress;

    @ApiModelProperty(value = "处理失败原因")
    @TableField("error_msg")
    private String errorMsg;

    @ApiModelProperty(value = "下载次数")
    @TableField("download_count")
    private Integer downloadCount;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "逻辑删除：0-未删除，1-已删除")
    @TableField("deleted")
    @TableLogic
    private Integer deleted;
}
